export default (initialState: App.InitialState) => {

  return {
    isLogin: () => {
      return initialState.currentUser !== undefined;
    },
    hasRole: (route: App.Route) => {
      return initialState.currentUser?.roles?.some(role => route.role?.some(configRole => configRole === role.name));
    },
  };
};
